import request from '@/utils/request'

/**
 * @description: 获取拆卸单列表
 */

export function getDisassembleOrderList(params) {
  return request({
    url: '/disassembleOrder/list',
    method: 'get',
    params
  })
}

/**
 * @description: 通过产品编号查询最新的进价或者是平均成本
 * @param {*} params
 * @return {*}
 */
export function selectPriceByProdId(params) {
  return request({
    url: '/disassembleOrder/selectPrice',
    method: 'get',
    params
  })
}

/**
 * @description: 通过产品编号查询批号
 * @param {*} params
 * @return {*}
 */
export function selectLotnumberByProdId(params) {
  return request({
    url: '/disassembleOrder/selectLotnumber',
    method: 'get',
    params
  })
}

/**
 * 保存拆卸单
 * @param {*} data
 * @returns
 */
export function saveDisassembleOrder(data) {
  return request({
    url: '/disassembleOrder/save',
    method: 'post',
    data
  })
}

/**
 * 查询拆卸单详情
 * @param {*} data
 * @returns
 */
export function getDetail(params) {
  return request({
    url: '/disassembleOrder/getDetail',
    method: 'get',
    params
  })
}

/**
 * 审核操作
 * @param {*} data
 * @returns
 */
export function examineOrderApi(data) {
  return request({
    url: '/disassembleOrder/check',
    method: 'post',
    data
  })
}

/**
 * 删除操作
 * @param {*} data
 * @returns
 */
export function deleteOrderApi(data) {
  return request({
    url: '/disassembleOrder/delete',
    method: 'post',
    data
  })
}
